package com.lanou3g.ptp.grade.mapper;

import com.lanou3g.ptp.entity.GradeRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface GradeRoleMapper {
    int addGradeRole(GradeRole gradeRole);

    void deleteById(Long id);

    void updateById(GradeRole gradeRole);

    List<GradeRole> findAll();

    GradeRole findById(Long id);

    List<GradeRole> findByGradeId(Long gradeId);

    List<GradeRole> findByStudentId(Long studentId);

    void deleteByGradeId(Long id);

    GradeRole findByGradeIdAndRoleId(@Param("gradeId") Long gradeId,
                                     @Param("roleId") long roleId);

    GradeRole findByTaskIdAndTeacherIdAndStudentId(@Param("taskId") Long taskId, @Param("teacherId") Long teacherId,
                                                   @Param("studentId") Long studentId);

    List<GradeRole> findByTaskIdAndTeacherId(@Param("taskId") Long taskId, @Param("teacherId") Long teacherId);
}

